package org.yuyao.biz1.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.yuyao.common.domain.vo.YuyaoResponse;

/**
 * 全局异常处理
 */
@ControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(RuntimeException.class)
    public YuyaoResponse handleFeignException(RuntimeException ex) {
        ex.printStackTrace();
        return YuyaoResponse.error(200,ex.getMessage());
    }
}
